//
//  QMAEntryModel.h
//  MiniAppSDK
//
//  Created by linseyzhou on 2019/7/18.
//

#import <Foundation/Foundation.h>
#import "QMAHostModel.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, QMAEntryModelType) {
    QMAEntryModelTypeNone,
    QMAEntryModelTypeC2C,
    QMAEntryModelTypeGroup,
    QMAEntryModelTypeDiscuss,
    QMAEntryModelTypeHost, // 宿主
    QMAEntryModelTypeChannel, // 频道入口
};

/// 小程序的弹出样式
typedef NS_ENUM(NSUInteger, QMAPresentModelType) {
    QMAPresentModelTypeNormal, // 常规
    QMAPresentModelTypeHalfScreen // 半屏
};

@interface QMAC2CModel : NSObject

@property (nonatomic, strong) NSString *uin;
@property (nonatomic, strong) NSString *name;

@end

typedef NS_ENUM(NSUInteger, QMAEntryIdentity) {
    QMAEntryIdentityNone,
    QMAEntryIdentityGroupMemeber = 1,
    QMAEntryIdentityGroupManager = 2,
    QMAEntryIdentityGroupAdmin = 3,
    QMAEntryIdentityGroupOther,
};

@interface QMAGroupModel : NSObject

@property (nonatomic, strong) NSString *groupUin;
@property (nonatomic, strong) NSString *groupName;
@property (nonatomic, assign) QMAEntryIdentity identity;
@property (nonatomic, assign) int64_t groupCategory; // 群类型

@end

/// 频道打开小程序附带的信息
@interface QMAGuildInfoModel : NSObject <NSSecureCoding>
/// 频道ID
@property (nonatomic, strong) NSString *guildID;
/// 子频道ID
@property (nonatomic, strong) NSString *channelID;
/// 是否是应用子频道
@property (nonatomic, assign) BOOL isMAChannel;

@end

@protocol QMANavigationItemProtocol;

@interface QMAEntryModel : NSObject
/// 小程序展示模式
@property (nonatomic, assign) QMAPresentModelType presentModelType;
@property (nonatomic, assign) QMAEntryModelType entryType;
@property (nonatomic, nullable, strong) QMAC2CModel *c2cModel; // QMAEntryModelTypeC2C
@property (nonatomic, nullable, strong) QMAGroupModel *groupModel; // QMAEntryModelTypeGroup;
@property (nonatomic, nullable, strong) QMAHostModel *hostModel; // QMAEntryModelTypeHost
@property (nonatomic, strong) QMAGuildInfoModel *guildInfoModel;
/// 导航栏样式的是实现实例
@property (nonatomic, nullable, strong) id<QMANavigationItemProtocol> navigationItem;
// 携带的额外参数
@property (nonatomic, nullable, strong) NSString *extraData;
// 关闭时是否强制杀掉应用
@property (nonatomic, assign) BOOL isTerminateOnClose;

- (NSString *_Nullable)entryDataHash;

@end

NS_ASSUME_NONNULL_END
